{% extends "mdb_base.html" %}

{% block styles %}
    {{ super() }}
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='adminlte/dist/css/signin.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='adminlte/dist/css/progress.css') }}">
{% endblock styles %}

{% block body_attribs %}security-page{% endblock body_attribs %}

{% block content %}
    {% from "macro.html" import render_field_with_errors %}
    <div class="security-box">
        <div class="card">
            <div class="card-body">
                <div class="text-center primary-text">
                    <h4 style="font-size: 1.2rem"><i class="fas fa-user"></i> {{ _("Login") }}</h4>
                    <hr class="mt-2 mb-2">
                </div>
                {% with messages = get_flashed_messages() %}
                    {% if messages %}
                        <div class="alert alert-danger">
                            {{ messages[0] }}
                        </div>
                    {% endif %}
                {% endwith %}
                <form class="form-signin" method="POST" action="


                        {{ url_for('auth_bp.login') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}"
                      name="login_user_form">
                    {{ login_user_form.hidden_tag() }}
                    {{ render_field_with_errors(login_user_form.email, "fas fa-envelope") }}
                    {{ render_field_with_errors(login_user_form.password, "fas fa-lock") }}
                    <div class="text-center mt-2">
                        {{ login_user_form.submit(class_="btn btn-primary btn-block") }}
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}
